<?php
    require 'common.php';
     $id =$_GET["id"];
        $tags = getAll("select * from tag");
        $t = getOne("select * from tag where id='$id'");

        $articles = getAll("select article.* ,tag.name as tag_name from article left join tag on article.tag_id=tag.id where tag_id ='$id'");


        $order = getAll("select * from article order by time desc limit 3");

        $smarty->assign("tags",$tags);
$smarty->assign("t",$t);
$smarty->assign("articles",$articles);
$smarty->assign("orders",$order);
$smarty->display("tag.html");
//require 'templates/tag.html';
?>